package com.cjz.demo4.go_on;

public class Observable {
    Action0 listener;

    public void subscribe(Action0 listener) {
        this.listener = listener;

        new Thread(this::press).start();
    }

    public void press() {
        if (listener != null) {
            listener.call();
        }
    }
}
